﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

namespace zielonka.co.uk.extensions.system
{
    //Description : Convert a double to a string formatted using the local currency settings.
    /*
        double test = 145.90;
        string testString = test.ToLocalCurrencyString();
     */

    public static partial class DoubleExtensions
    {
        /// <summary>
        /// Format a double using the local culture currency settings.
        /// </summary>
        /// <param name="value">The double to be formatted.</param>
        /// <returns>The double formatted based on the local culture currency settings.</returns>
        public static string ToLocalCurrencyString(this double value)
        {
            return (String.Format("{0:C}", value));
        }
    }
}
